class Solution(object):
    def maxRepeating(self, sequence, word):
        k = 0
        i = 0
        n = len(sequence)
        m = len(word)
        while i < n:
            s = sequence[i:]
            t = len(s)
            index = s.find(word)
            if index == -1:
                i += 1
                continue
            else:
                if index == 0:
                    num = 1
                    index += m
                    while index + m <= t:
                        if s[index: index + m] == word:
                            num += 1
                            index += m
                        else:
                            break
                    k = max(k, num)
                i += 1
        return k
